package fr.upmc.i3s.upmcontact.contents;

import java.util.Date;

public class UpmcInfo extends Published {

	private static final long serialVersionUID = 9213080566869708863L;
	
	private String recipients;
	
	public UpmcInfo() {
		super();
		this.recipients = null; 
	}
	
	public UpmcInfo(String id, Date createdAt, Date updatedAt,
							String title, String description, String photoPath, String link, User publishedBy,
								String recipients) {
		super(id, createdAt, updatedAt, title, description, photoPath, link, publishedBy);
		this.recipients = recipients;
	}

	public String getRecipients() {
		return recipients;
	}

	public void setRecipients(String recipients) {
		this.recipients = recipients;
	}

	@Override
	public int hashCode() {
		return super.hashCode();
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (!super.equals(obj))
			return false;
		if (getClass() != obj.getClass())
			return false;
		UpmcInfo other = (UpmcInfo) obj;
		if (recipients == null) {
			if (other.recipients != null)
				return false;
		} else if (!recipients.equals(other.recipients))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return super.toString() + " UpmcInfo [recipients=" + recipients + "]";
	}
	
}
